home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / SHELLOUT.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-17  |  2KB  |  45 lines

  1. {--------------------------------------------------------------}
  2. {                           ShellOut                           }
  3. {                                                              }
  4. {    "Shell to DOS" with screen save demonstration program     }
  5. {                                                              }
  6. {                             by Jeff Duntemann                }
  7. {                             Turbo Pascal V5.0                }
  8. {                             Last update 7/17/88              }
  9. {                                                              }
  10. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  11. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  12. {--------------------------------------------------------------}
  13.  
  14. PROGRAM ShellOut;
  15.  
  16. {$M 16384,16384,16384}  { Reserve some heap to save the screen }
  17.  
  18. USES DOS,CRT,BoxStuff;  { Boxstuff described in Section 17.3 }
  19.  
  20. TYPE
  21.   AdapterType = (None,MDA,CGA,EGAMono,EGAColor,VGAMono,
  22.                  VGAColor,MCGAMono,MCGAColor);
  23.  
  24. VAR
  25.   Stash : Pointer;
  26.  
  27.  
  28. {$I WRITEAT.SRC}        { Described in Section 18.3 }
  29. {$I QUERYDSP.SRC}       { Described in Section 18.4 }
  30. {$I FONTSIZE.SRC}       { Described in Section 18.4 }
  31. {$I SAVESCRN.SRC}       { Described in Section 20.10 }
  32. {$I RSTRSCRN.SRC}       { Described in Section 20.10 }
  33.  
  34.  
  35.  
  36. BEGIN
  37.   ClrScr;
  38.   MakeBox(1,1,80,24,GrafChars);
  39.   WriteAt(-1,3,True,False,'** Relatively Dumb Parent Program **');
  40.   GotoXY(10,10); Write('Press CR to shell to DOS: '); Readln;
  41.   SaveScreen(Stash);
  42.   Exec('C:\COMMAND.COM','');
  43.   RestoreScreen(Stash);
  44. END.
  45.